
<%@page import="bean.MemberDTO"%>
<%@ page import="bean.MemberVO" %>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/B01member.css" />
<script type="text/javascript" src="../js/member.js"></script>
<title>회원 List(list.jsp)</title>
</head>
<body>
<jsp:useBean id="vo" class="bean.MemberVO" scope="page"/>
<jsp:setProperty property="*" name="vo"/>
<h1>회원 List </h1>
<form name="hiddenFrm" method="post">
	<input type="hidden" name= "nowPage" value="<%=vo.getNowPage()%>">
	<input type="hidden" name= "find" value="<%=vo.getFind()%>">
	<input type="hidden" name= "rno" value="<%=vo.getRno()%>">
</form>
<%
	MemberDTO dto = new MemberDTO();
	dto.setVo(vo);
	ArrayList<MemberVO> al = dto.select();
%>
	<hr>
	<div>
		<form action="index.jsp?inc=../Member/list.jsp" name ='member_list_frm' method = 'post'>
			<input type="text" name = 'find' value ="<%=vo.getFind()%>"/>
			<input type="submit" value='검색'>
		</form>
	</div>
	<p/>
	<div id = 'member_list_title'>
		<div class='member_list_rno'>순번</div>
		<div class='member_list_mid'>아이디</div>
		<div class='member_list_data2'>이름</div>
		<div class='member_list_data3'>연락처</div>
		<div class='member_list_data3'>이메일</div>
	</div>
<%for(int a=0; a<al.size(); a++){ 
	MemberVO v = al.get(a);
%>
 <div class="member_list_items">
<%-- 		<div class='member_list_rno'><%=v.getRno() %></div> <!-- 실제 넘어가는 값  --> 
			<div class='member_list_mid'><%=v.getMid() %></div> <!-- 실제 클릭되는 값   -->--%>
		<div class='member_list_rno'><%=v.getRno() %></div>
		<div class='member_list_mid'> <!-- 실제 클릭되는 값   -->
			<a href = "#" onclick="goView(<%=dto.getNowPage()%>,<%=v.getRno()%>)"><%=v.getMid()%></a>
		</div>	
		<div class='member_list_data2'><%=v.getIrum()%></div>
		<div class='member_list_data3'><%=v.getPhone() %></div>
		<div class='member_list_data3'><%=v.getEmail() %></div>
		
	</div>	
<%}%>
<div id = 'list_page' style="margin: auto;">
<a href = "#" onclick="goPage(1)">첫 페이지</a>
<% if(dto.getNowBlock() != 1){%>
	<a href = "#" onclick="goPage(<%=dto.getStartPage()-1%>)">이전 페이지</a>
<%} %>
<%
	int i = 0;
	for(i = dto.getStartPage(); i<= dto.getEndPage(); i++){%>
		<a href = "#" onclick="goPage(<%=i%>)"><%=i%></a>
	<%}%>
<%if(dto.getNowBlock() != dto.getTotBlock()){ %>
	<a href = "#" onclick="goPage(<%=i%>)">다음 페이지</a>
<%} %>
<a href = "#" onclick="goPage(<%=dto.getTotPage()%>)">마지막 페이지</a>
</div>
	<hr>
		<input type="button" value="성적입력" id="btnInput"/>

<script type="text/javascript">listInit();</script>
</body>
</html>